<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <h:form id="form">

            <p:panel id="panel" header="Categoria" style="margin-bottom:10px;">
                <p:messages id="messages" />
                <h:panelGrid columns="3">
                    <h:outputLabel for="nome" value="Nome: *" />
                    <p:inputText id="nome" 
                                 value="#{pprBean.firstname}" required="true" label="Nome">
                        <f:validateLength minimum="2" />
                    </p:inputText>
                    <p:message for="firstname" />

                    <h:outputLabel for="surname" value="Surname: *" />
                    <p:inputText id="surname" 
                                 value="#{pprBean.surname}" required="false" label="Surname"/>
                    <p:message for="surname" />
                </h:panelGrid>
            </p:panel>

            <p:commandButton value="Ajax Submit" update="panel,display" id="ajax"
                             actionListener="#{pprBean.savePerson}" />

            <p:commandButton value="Non-Ajax Submit" actionListener="#{pprBean.savePerson}" 
                             ajax="false" />

            <p:commandButton value="With Icon" actionListener="#{pprBean.savePerson}" id="withIcon" 
                             update="panel,display" icon="ui-icon-disk" />

            <p:commandButton actionListener="#{pprBean.savePerson}" update="panel,display" id="iconOnly"
                             icon="ui-icon-disk" title="Icon Only"/>

            <p:commandButton value="Disabled" disabled="true" id="disabled" />

            <p:panel id="display" header="Information" style="margin-top:10px;">
                <h:panelGrid columns="2">
                    <h:outputText value="Firstname: " />
                    <h:outputText value="#{pprBean.firstname}" />

                    <h:outputText value="Surname: " />
                    <h:outputText value="#{pprBean.surname}" />
                </h:panelGrid>
            </p:panel>

        </h:form>

    </h:body>
</html>